Copyright: TRenderDX, @ Copyright Eldermage Corp., 1997


TRenderDX

Copyright

Contact Information

Purchasing TRenderDX

Note: ActiveX Users:

This help file is not yet complete. Until that time, this helpfile will seem aimed toward Delphi programmers. We are working hard to complete the help files and documentation. Until that time, this help file is very close to the activeX help file. This component has been tested with Visual Basic 5.

Description

This is a BETA version of TRenderDX, the 3D Game Engine component for Delphi and Visual Basic (32 bit). This demo version is limited to 64 sectors. This Beta has been extensively tested under Windows 95 and Windows NT4, but there are still several areas needing work. One area that is not fully completed is this help file. See contact information for bug reports or support questions.

To make levels for this component, you need the world editor, available where you got this, or on our website: www.eldermage.com

•Installation

Copy the file '4DXDLL.DLL' to your Windows directory, or to your windows\system (or system32) directory. The Rendering component requires that the DLL be in the path, or it will not execute. If you do not have the DLL in the path, or in your windows system directory, it could cause your component library to fail loading. To correct this, remove the TRenderDX component.

Load Delphi, and choose the Install from the Components menu. Choose ADD from the dialog box, and choose Browse. Change the 'files of type' to 'Unit File (*.DCU)', and locate the RDX.DCU file. Choose Okay from the main dialog. The TRenderDX component will be located on the Eldermage tab.

•Performance

256 color mode  - Read this!

Map Design issues

•Properties

ActorDefs

Align

AutoMove

BitmapSet

Cursor

DataPitch

DataPointer

FlatSet

Height

Left

Level

MapMode

MapZoom

Palette

PaletteFile

PalPointer

Shear

TextureSet

Top

Visible

Width

•Methods

Render

MoveActor

SpinActor

PovActor

PositionActor

CheckActor

RaiseSectorFloor

RaiseSectorCeiling

ShadeTo

AltShadeTo

FindSector

AddActor

GetPalette

GetActor

GetSector

SetBounds

MakePalette

GetPalPointer

GetDataPointer

•Events

OnActorCross

OnLineCross

OnSectorEntry


Property - BitmapSet

The filename of the BitmapSet file. This file contains the complete bitmap data data needed for texture building. This file is created in the Edit4DX Map Editor. For help on creation and modification of a BitmapSet, please consult the Edit4dx help file.


Property - ActorDefs
TRenderDX Property - ActorDefs

The filename of the ActorDefs file. This file contains the data needed to associate Actors with Texture Definitions. This file is created in the Edit4DX Map Editor. For help on creation and modification of ActorDef's, please consult the Edit4dx help file.


Property - Cursor
TRenderDX Property - Cursor


Property - FlatSet
TRenderDX Property - FlatSet

The filename of the FlatSet file. This file contains the complete bitmap data data needed for rendering floors and ceilings. This file is created in the Edit4DX Map Editor. For help on creation and modification of a FlatSet, please consult the Edit4dx help file.


Property - Level
TRenderDX Property - Level

The filename of the level file. This file contains all the data.needed for initializing a level. It contains the sectors, linedefs, vertexes and actors instances for one level. Setting this property will load the new level, completely replacing the old level. This file is created in the Edit4DX Map Editor. For help on creation and modification of levels, please consult the Edit4dx help file.


Property - MapZoom
TRenderDX Property - MapZoom

This option sets the level of zoom on the map. Range is 0 - 8.

The smaller the number, the larger the map is displayed.


Property - PaletteFile
TRenderDX Property - PaletteFile

The filename of a palette file. This is the data that TRenderDX will use to color your display, and shade textures. It is a straight dump of 768 byte values, arranged R,G,B,R,G,B,R,G,B etc. starting from color0 to color 255.


Property - Texture Set
TRenderDX Property - TextureSet

The filename of the TextureSet file. This file contains the definitions of textures and patches that are used to render walls and sprites. This file is created in the Edit4DX Map Editor. For help on creation and modification of levels, please consult the Edit4dx help file.


Event - OnActorCross
TRenderDX Event - OnActorCross

This event is generated when an actor bumps into or runs over another actor. This can be used to pick up potions, Inflict missile damage, trigger events, etc.


Event - OnLineCross
TRenderDX Event - OnLineCross

This event is generated when an actor crosses a line that has the 'Notify' flag set. This can be used to trigger events, cause damage, restore health, teleport, etc.


Event - OnSectorEntry
TRenderDX Event - OnSectorEntry

This event is generated when an actor enters a sector actor. This can be used to trigger events when an actor enters an area.


Copyright

TRenderDX and it's supporting files are copyright 1997, by Eldermage Corp. All rights reserved.

You may distribute this evaluation version of TRenderDX only in complete, original, and unmodified form, without any extra files being added. Any other distribution is expressly prohibited.

This evaluation version of TRenderDX, and the 4DXDLL.DLL, may only be used for testing purposes. Any other use is strictly prohibited.

THIS SOFTWARE IS DISTRIBUTED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE  OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. YOU USE IT AT YOUR OWN RISK. THE AUTHOR WILL NOT BE LIABLE FOR ANY DATA LOSS, DAMAGES,  LOSS OF PROFITS OR OTHER KIND OF LOSS WHILE USING OR MISUSING THIS SOFTWARE.

You may not attempt to reverse compile, modify, translate or disassemble the software in whole or in part.

Contact Information:

web:    http://www.eldermage.com

Email:  jaimi@eldermage.com


Automove

This option is used for testing purposes to enable the control to process mouse messages for movement. This is not timed, and should only be used during development. Default is on.

For correct movement, call the MoveActor Method.


Property - MapMode

Determines how the map is displayed.

0 - map is not displayed. (default)

1 - only map is displayed, rendering is disabled.

2 - Map is displayed over rendering. Neat, but disorienting.


Property - Shear

Skews the view up or down by the shear value.  Setting this to a negative value will cause the next rendering to point down toward the floor. A Positive value will cause it to point up, looking toward the ceiling.


Contact Information

Eldermage Corp. Can be found on the web at the following Address:

http://www.eldermage.com

Send bug reports to:

bugs@eldermage.com

Send support questions to

support@eldermage.com

Postal mail can be addressed to:

Eldermage

111 Alberta St.

Harrison, AR 72601

USA


Purchasing TRenderDX

This is an evaluation version. RenderDX is available packaged with diskettes and manual in the following configurations:

Delphi

TRenderDX For Delphi   - $195

Map Editor Source Code - $195

Visual Basic and Everything else

RenderDX - ActiveX     - $245

4DXDLL & Interfaces    - $245

Visual C++ Only

Linkable Library       - $500

Send check or money order to:

Eldermage Corp.

111 Alberta St.

Harrison, AR 72601

USA.

For speedier delivery, please contact:

admin@eldermage.com

For updated information, please consult our webpage at:

http://www.eldermage.com


Properties - Palette

This is the handle of the 256 color palette used by the 4DX bitmap.

When you are running in 256 color mode (the recommended mode).

You must use this to set your forms default palette, or windows cannot display the rendered bitmap correctly.

In the public section of your form, you must override the GetPalette Function and replace it with yours:

 {in your form declaration}

 public

    function  GetPalette : HPalette; override;

 {your form declaration continues }

{ you must supply this function for 256 color

  graphics mode to work correctly}

function  TForm1.GetPalette : HPalette;

begin

  result := HPalette(RenderDX1.Palette);

end;

in the OnShow section of your form, do the following:

procedure TTextureEdit.FormShow(Sender: TObject);

begin

     SelectPalette(canvas.handle,HPalette(RenderDX1.Palette),false);

     RealizePalette(canvas.handle);

end;


Method - Render

Renders the view into the bitmap buffer. To display it,

you must repaint the control:

RenderDX1.render(0,0); // set these to 0 for now

RenderDX1.repaint;


Method - MoveActor

Moves an actor forward, in the direction they are pointing.

RenderDX.MoveActor(0,12.5); // moves actor 0 by 12.5 units.


SpinActor
Method - SpinActor

Spins an actor by n degrees. In 4DX terms, there are 1024 internal degrees in a circle.

RenderDX1.SpinActor(0,512); // turns actor 0 completely around.


PovActor

Sets the "Point of View" Actor. All subsequent renderings come from this actors POV. Typical use is controlling multiple actors, views from cameras, etc.

RenderDX.PovActor(0); // Sets the pov to be generated from Actor 0 - the default actor.


Method - PositionActor

Postions actor at coordinates passed. Typical uses are for teleporting etc.

// This positions actor 0 at x:100, y:200, height = 300. Angle = 512.

RenderDX1.PositionActor(0,100,200,300,512);


Method - CheckActor

This method must be called for all moving actors, so that gravity can work upon them.

RenderDX1.CheckActor(0); // make sure that actor 0 has gravity


Performance

To get maximum performance - especially under Windows NT - you should run your application in 256 color mode. There are several steps you must do to initialize your palette with delphi. Please see the Palette property for the steps you need to display the DIB correctly.


Map Design / Performance Issues

Large areas should be subdivided into multiple sectors. It may be tempting to create a large sector, and fill it with small sectors, but this will lead to lower performance. Don't split lines in sectors unless needed - more lines mean more sorting per frame. Unlike other engines, RenderDX sorts the visible lines and sectors for every frame. This allows you to have moving sectors, like doors, etc.


Method - ShadeTo

  Rebuilds the standard shading table. Pass the R,G,B of the destination color, and the distance (in units) to the fadeout point. The standard palette is best fit for shading to black, though any color can actually be shaded to, and the engine will compensate with "best fit" colors.

Examples:

RenderDX1.ShadeTo(0,0,0,512);   // shades to black, things past 512 distance are dark. Shading to 512 is very dark.

RenderDX1.ShadeTo(0,0,0,2000);  // shades to black, (r,g,b = 0); An average shading value.

RenderDX1.ShadeTo(0,0,0,4000);  // shades to black, (r,g,b = 0); A light area. Doesn't get dark too quickly.

RenderDX1.ShadeTo(192,192,192,1024); // this shades to a light gray, like a fog.

RenderDX1.ShadeTo(128, 0 , 0, 1024); // this shades to a blood red color.


AltShadeTo
Method - AltShadeTo

This defines the alternate shading table. Sectors with the 'Alternate Shading' flag are shaded with this table. In the viewport, any sectors past the alternate shaded sector are also shaded with this table, regardless of their flags - This makes possible things like pillars of blue fog, etc. Please see the ShadeTo method for information on how to call this method.


Method - RaiseSectorFloor

Changes the floor height of a sector to a specified number in a certain amount of time.

RenderDX1.RaiseSectorFloor(0,200


Property - Align
TRenderDX Property - Align

Use Align to align a control to the top, bottom, left, or right of a form or panel and have it remain there even if the size of the form, panel, or component that contains the control changes.

Possible Alignment values : alNone, alTop, alBottom, alLeft,alRight, and alClient.


Property - Height
TRenderDX Property - Height

The Height property determines the height of the render control in pixels.


Property - Left
TRenderDX Property - Left

The position of the left side of the control on the form.


Property - Top
TRenderDX Property - Top

This property determines where the top of the control appears on the form.


Property - Width
TRenderDX Property - Width

This property is the width of the component window on the form.


Method - AddActor

This method adds an actor to a sector with specific attributes.

AddActor ( Number, ActorType : Integer; X, Y, Height : Double; Sector : Integer);

Number : The number which can be used to refer to the actor.

ActorType : The Actor type defined in the ActorDefs file.

X, Y : The X and Y coordinates to place the actor.

Height : The height of the actor.

Sector : The sector to place the actor.

Example

RenderDX.AddActor(1,1,300,300,64,1) //Adds actor # 1 of type 1 to Sector 1 at coordinates (300,300).


Method - RaiseSectorFloor

This method changes the height of the floor in a sector.

RaiseSectorFloor( Sector, Height, Speed : Integer);

Sector : The sector which will be changed.

Height : The new height to move the floor to.

Speed : The speed at which the floor level changes.

Example

RenderDX.RaiseSectorFloor(1,300,3) //Changes the floor height in sector 1 to 300 at a speed of 3.


Method - RaiseSectorCeiling

This method changes the height of the ceiling in a sector.

RaiseSectorCeiling( Sector, Height, Speed : Integer);

Sector : The sector which will be changed.

Height : The new height to move the ceiling to.

Speed : The speed at which the ceiling level changes.

Example

RenderDX.RaiseSectorCeiling(1,500,3) //Changes the ceiling height in sector 1 to 500 at a speed of 3.


Method - FindSector

This method determines in which sector an x,y coordinate fall in.

FindSector(X, Y : Double);

Example

Sector := RenderDX.FindSector(300,200); //Finds the sector which contains the coordinates (300,200)


Method - Getpalette

This method returns a standard Windows h-palette.


Method - GetActor

This method returns a pointer to the actor.

GetActor(ActorNumber) : Integer;

Example

RenderDX.GetActor(2);  // Returns a pointer to actor 2.


Method - GetSector

This method returns a pointer to a sector.

GetSector(SectorNumber) : Integer;

Example

RenderDX.GetSector(20);  // Returns a pointer to sector 2.


Method - SetBounds

This is a method to set the location of the control on the form.

SetBounds(Left, Top, Width, Height: Integer);


Method - MakePalette

This method accepts a pointer to an RGB palette and sets it as the user palette.

Example

RenderDX.MakePalette(MyPalette); // Sets the palette to MyPalette.


Method - GetPalPointer

This method returns a pointer to the 256 color RGB palette.

Example

MyPalette := RenderDX.GetPalPointer; // MyPalette now points to the RGB palette


Method - GetDataPointer

This method returns a pointer to the rendered map image.  This allows post editing of the render window.


Property - Visible
TRenderDX Property - Visible

This property determines whether the control is visible.


Property - DataPitch
TRenderDX Property - DataPitch

The width in pixels from edge to edge of the rendering bitmap.  Note that this is not always the width of the control.


Property - DataPointer
TRenderDX Property - DataPointer

The pointer to the rendered image of the map.


Property - PalPointer
TRenderDX Property - PalPointer

This property contains the pointer to the 256 color RGB palette currently being used.


Glossary

D

DIB


DIB

Device Independent Bitmap. This is the type of bitmap that RenderDX will create the view in.